let MyPromise = require('./06-myPromise');

const promise1 = MyPromise.resolve(3);
const promise2 = new MyPromise((resolve, reject) => setTimeout(reject, 100, 'foo'));

MyPromise.allSettled([promise1, promise2]).then(res => console.log(res));

const promise3 = new MyPromise((resolve, reject) => {
    setTimeout(resolve, 500, 'one');
  });
  
  const promise4 = new MyPromise((resolve, reject) => {
    setTimeout(resolve, 100, 'two');
  });
  
  Promise.race([promise3, promise4]).then((value) => {
    console.log(value);
    // Both resolve, but promise2 is faster
  });